import java.util.Scanner;
public class ReverseWords {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String sentence = scanner.nextLine();
        String reversed = reverseWords(sentence);
        System.out.println(reversed);
    }

    private static String reverseWords(String sentence) {
        //将句子按空格分割成单词数组
        String[] words = sentence.split(" ");
        //创建一个StringBuilder用于构建结果字符串
        StringBuilder reversedSentence = new StringBuilder();
        //从后面往前遍历单词数组，除了最后一个单词外，其他单词后面都添加空格
        for (int i = words.length - 1; i >= 0; i--) {
            reversedSentence.append(words[i]);
            if (i > 0) {
                reversedSentence.append(" ");
            }
        }
        //返回构建好的倒置句子
        return reversedSentence.toString();
    }

}

//任务：对一句话中的单词进行倒置处理，标点不倒置。例如："I like beijing." 经过处理后变为："beijing. like I"。